package com.cbw.bean;
import java.io.Serializable;
/**
 * 快递实体类
 */
public class Express implements Serializable {
    private static final long serialVersionUID = 7859017056410332717L; //实现序列化接口
    private String number;//快递单号
    private String company;//快递公司
    private int code;//取件码
    private int target;//快递位置(0-100),显示时按第几排第几列显示,10排10列

    public Express(String number, String company) {
        this.number = number;
        this.company = company;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public int getTarget() {
        return target;
    }

    public void setTarget(int target) {
        this.target = target;
    }

    @Override
    public String toString() {
        return "Express{" +
                "number='" + number + '\'' +
                ", company='" + company + '\'' +
                ", code='" + showTarget()+'}';
    }

    /**
     * 展示快递位置(第几排第几列)，target存的时候是int,展示的时候是string
     * @return
     */
    public String showTarget() {
        return target/10+"排"+target%10+"列";
    }
}